#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
	int i, j, max_cl;
	
	while(true)
	{
		cin >> i >> j ;
		
		int swap_i, swap_j;

		if( i < j )
		{
			swap_i = i;
			swap_j = j;
		}
		else
		{
			swap_i = j;
			swap_j = i;
		}

		if( cin.eof() )
			break;

		for(int k = swap_i; k <= swap_j; ++k)
		{
			int tmp = k;
			int cycle_length = 0;
			while(true)
			{
				++cycle_length;
				if(tmp == 1)
					break;
				if( (tmp % 2) == 1)
					tmp = (3 * tmp) + 1;
				else
					tmp = tmp / 2;
			}
			if( swap_i == k )
				max_cl = cycle_length;
			if( max_cl < cycle_length )
				max_cl = cycle_length;
		}
		cout << i << " " << j << " " << max_cl << endl;
	}
	
#ifndef ONLINE_JUDGE
	system("pause");
#endif

	return 0;
}